package chai.ning.inner;

public class Human {
	
	static String home = "地球"; 
	String name = "人";
	
	public static class Brain{
		
		String name = "脑子";
		
		public void show() {
			System.out.println("Human home : " + Human.home );
			System.out.println("Brain name : " + this.name );
			
			Human h = new Human();
			System.out.println("Human name : " + h.name);
		}
		
	}
	
	public class Heart{
		
		String name = "心脏";
				
		public void show() {
			System.out.println("Human home : " + Human.home);
			System.out.println("Human name : " + Human.this.name);
			System.out.println("Heart name : " + this.name);
		}
	}
	
	public static void main(String[] args) {
		
		Class<?> c = Brain.class.getEnclosingClass();
		System.out.println( c );
		
		Brain b = new Brain();
		System.out.println( b.name );
		
		c = Heart.class.getEnclosingClass();
		System.out.println( c );
		
		Human human = new Human();
		Heart h = human.new Heart();
		System.out.println( h.name );
	}
}
